home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / GRAPHICS / POV_3 / SCENES / ADVANCED / C-SHAPES.POV next >
Encoding:
Text File  |  2005-03-08  |  11.8 KB  |  299 lines

  1. /*         
  2.           COMPOUND SOLIDS for POV-Ray 2.2
  3.           ===============================
  4.       Constructed by Grant Hutchison [100047,144]  
  5. Much data and encouragement from Tom Gettys [72730,2013]
  6. Other data from "Polyhedron Models" by Magnus Wenninger
  7.  
  8. Compounds and intersections of the simple Platonic solids
  9. can be used to generate several interesting shapes which
  10. highlight the relationships between the Platonics. Several
  11. compounds are declared below, with their component solids
  12. coloured to show up clearly. In each case, the vertices
  13. of the component solids define one regular shape, while
  14. their intersection defines another. (It is interesting
  15. to convert "union" to "intersection" and look at the
  16. results.)
  17. The file starts with the declaration of the unit solids
  18. necessary to create the compounds.
  19. */
  20.  
  21. #include "colors.inc"
  22.  
  23. //UNIT SOLIDS
  24. //These solids are based on those created by Tom Price
  25. //for the shapes2.inc file, but some of the angles and
  26. //orientations are different.
  27.  
  28. #declare Unit_Tetrahedron =
  29. intersection {  
  30.   plane { -z, 1 rotate <35.264390, 45, 0> }
  31.   plane { -z, 1 rotate <35.264390, 225, 0> }
  32.   plane { -z, 1 rotate <-35.264390, 135, 0> }
  33.   plane { -z, 1 rotate <-35.264390, 315, 0> }
  34. }
  35.  
  36. #declare Unit_Cube =
  37. box { <-1, -1, -1>, <1, 1, 1> } 
  38.  
  39. #declare Unit_Octahedron = 
  40. intersection {
  41.   plane { -z, 1 rotate <35.264390, 45, 0> }
  42.   plane { -z, 1 rotate <35.264390, 135, 0> }
  43.   plane { -z, 1 rotate <35.264390, 225, 0> }
  44.   plane { -z, 1 rotate <35.264390, 315, 0> }
  45.   plane { -z, 1 rotate <-35.264390, 45, 0> }
  46.   plane { -z, 1 rotate <-35.264390, 135, 0> }
  47.   plane { -z, 1 rotate <-35.264390, 225, 0> }
  48.   plane { -z, 1 rotate <-35.264390, 315, 0> }
  49. }
  50.  
  51. #declare Unit_Dodecahedron =
  52. intersection {
  53.   plane { -z, 1 rotate <26.565051, 36, 0> }
  54.   plane { -z, 1 rotate <26.565051, 108, 0> }
  55.   plane { -z, 1 rotate <26.565051, 180, 0> }
  56.   plane { -z, 1 rotate <26.565051, 252, 0> }
  57.   plane { -z, 1 rotate <26.565051, 324, 0> }
  58.   plane { -z, 1 rotate <-26.565051, 0, 0> }
  59.   plane { -z, 1 rotate <-26.565051, 72, 0> }
  60.   plane { -z, 1 rotate <-26.565051, 144, 0> }
  61.   plane { -z, 1 rotate <-26.565051, 216, 0> }
  62.   plane { -z, 1 rotate <-26.565051, 288, 0> }
  63.   plane { -z, 1 rotate -90*x }
  64.   plane { -z, 1 rotate 90*x }
  65. }
  66.  
  67. #declare Unit_Icosahedron =
  68. intersection {
  69.   plane { -z, 1 rotate <52.622632, 0, 0> }
  70.   plane { -z, 1 rotate <52.622632, 72, 0> }
  71.   plane { -z, 1 rotate <52.622632, 144, 0> }
  72.   plane { -z, 1 rotate <52.622632, 216, 0> }
  73.   plane { -z, 1 rotate <52.622632, 288, 0> }
  74.   plane { -z, 1 rotate <10.812317, 0, 0> }
  75.   plane { -z, 1 rotate <10.812317, 72, 0> }
  76.   plane { -z, 1 rotate <10.812317, 144, 0> }
  77.   plane { -z, 1 rotate <10.812317, 216, 0> }
  78.   plane { -z, 1 rotate <10.812317, 288, 0> }
  79.   plane { -z, 1 rotate <-10.812317, 36, 0> }
  80.   plane { -z, 1 rotate <-10.812317, 108, 0> }
  81.   plane { -z, 1 rotate <-10.812317, 180, 0> }
  82.   plane { -z, 1 rotate <-10.812317, 252, 0> }
  83.   plane { -z, 1 rotate <-10.812317, 324, 0> }
  84.   plane { -z, 1 rotate <-52.622632, 36, 0> }
  85.   plane { -z, 1 rotate <-52.622632, 108, 0> }
  86.   plane { -z, 1 rotate <-52.622632, 180, 0> }
  87.   plane { -z, 1 rotate <-52.622632, 252, 0> }
  88.   plane { -z, 1 rotate <-52.622632, 324, 0> }
  89. }
  90.  
  91. // COMPOUNDS
  92.  
  93. #declare Two_Tetrahedra =
  94. //Intersection defines an octahedron
  95. //Vertices define a cube
  96. union {
  97.   object {Unit_Tetrahedron pigment {color White}}
  98.   object {Unit_Tetrahedron rotate 90*y pigment {color Blue}}
  99.   scale <0.577350, 0.577350, 0.577350>
  100.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  101. }
  102.  
  103. #declare Five_Tetrahedra =
  104. //Intersection defines an icosahedron
  105. //Vertices define a dodecahedron
  106. union {
  107.   object {Unit_Tetrahedron rotate <31.717474, 0, 0> pigment {color White}}
  108.   object {Unit_Tetrahedron rotate <31.717474, 72, 0> pigment {color Blue}}
  109.   object {Unit_Tetrahedron rotate <31.717474, 144, 0> pigment {color Magenta}}
  110.   object {Unit_Tetrahedron rotate <31.717474, 216, 0> pigment {color Red}}
  111.   object {Unit_Tetrahedron rotate <31.717474, 288, 0> pigment {color Green}}
  112.   scale <0.419469, 0.419469, 0.419469>
  113.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  114.  
  115. #declare Ten_Tetrahedra =
  116. //Intersection defines an icosahedron
  117. //Vertices define a dodecahedron
  118. union {
  119.   object {Unit_Tetrahedron rotate <31.717474, 0, 0> pigment {color White}}
  120.   object {Unit_Tetrahedron rotate <31.717474, 72, 0> pigment {color Blue}}
  121.   object {Unit_Tetrahedron rotate <31.717474, 144, 0> pigment {color Magenta}}
  122.   object {Unit_Tetrahedron rotate <31.717474, 216, 0> pigment {color Red}}
  123.   object {Unit_Tetrahedron rotate <31.717474, 288, 0> pigment {color Green}}
  124.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 0, 0> pigment {color Yellow}}
  125.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 72, 0> pigment {color Orange}}
  126.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 144, 0> pigment {color Cyan}}
  127.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 216, 0> pigment {color Pink}}
  128.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 288, 0> pigment {color Grey}}
  129.   scale <0.419469, 0.419469, 0.419469>
  130.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  131.  
  132. #declare Five_Cubes =
  133. //Intersection defines a rhombic triacontahedron
  134. //Vertices define a dodecahedron
  135. union {  
  136.   object { Unit_Cube rotate <31.717474, 0, 0> pigment {color White}}
  137.   object { Unit_Cube rotate <31.717474, 72, 0> pigment {color Blue}}
  138.   object { Unit_Cube rotate <31.717474, 144, 0> pigment {color Magenta}}
  139.   object { Unit_Cube rotate <31.717474, 216, 0> pigment {color Red}}
  140.   object { Unit_Cube rotate <31.717474, 288, 0> pigment {color Green}}
  141.   scale <0.726542, 0.726542, 0.726542>
  142.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  143. }
  144.  
  145. #declare Five_Octahedra =
  146. //Intersection defines an icosahedron
  147. // Vertices define an icos1dodecahedron
  148. union {
  149.   object {Unit_Octahedron rotate <31.717474, 0, 0> pigment {color White}}
  150.   object {Unit_Octahedron rotate <31.717474, 72, 0> pigment {color Blue}}
  151.   object {Unit_Octahedron rotate <31.717474, 144, 0> pigment {color Magenta}}
  152.   object {Unit_Octahedron rotate <31.717474, 216, 0> pigment {color Red}}
  153.   object {Unit_Octahedron rotate <31.717474, 288, 0> pigment {color Green}}
  154.   scale <0.678716, 0.678716, 0.678716>
  155.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  156. }
  157.  
  158. #declare Octahedron_Cube =
  159. //Intersection defines a cuboctahedron
  160. //Vertices define a rhombic dodecahedron
  161. union {
  162.   object {Unit_Cube pigment {color Blue}}
  163.   object {Unit_Octahedron scale <1.154700, 1.154700, 1.154700> pigment {color White}}
  164.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  165. }
  166.  
  167. #declare Icosahedron_Dodecahedron =
  168. //Intersection defines an icosidodecahedron
  169. //Vertices define a rhombic triacontahedron
  170. union {
  171.   object {Unit_Dodecahedron pigment {color Red}}
  172.   object {Unit_Icosahedron scale <1.098014, 1.098014, 1.098014> pigment {color Green}}
  173.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  174. }
  175.  
  176. #declare Two_Tetrahedra_i =
  177. //Intersection defines an octahedron
  178. //Vertices define a cube
  179. intersection {
  180.   object {Unit_Tetrahedron pigment {color White}}
  181.   object {Unit_Tetrahedron rotate 90*y pigment {color Blue}}
  182.   scale <0.577350, 0.577350, 0.577350>
  183.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  184. }
  185.  
  186. #declare Five_Tetrahedra_i =
  187. //Intersection defines an icosahedron
  188. //Vertices define a dodecahedron
  189. intersection {
  190.   object {Unit_Tetrahedron rotate <31.717474, 0, 0> pigment {color White}}
  191.   object {Unit_Tetrahedron rotate <31.717474, 72, 0> pigment {color Blue}}
  192.   object {Unit_Tetrahedron rotate <31.717474, 144, 0> pigment {color Magenta}}
  193.   object {Unit_Tetrahedron rotate <31.717474, 216, 0> pigment {color Red}}
  194.   object {Unit_Tetrahedron rotate <31.717474, 288, 0> pigment {color Green}}
  195.   scale <0.419469, 0.419469, 0.419469>
  196.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  197.  
  198. #declare Ten_Tetrahedra_i =
  199. //Intersection defines an icosahedron
  200. //Vertices define a dodecahedron
  201. intersection {
  202.   object {Unit_Tetrahedron rotate <31.717474, 0, 0> pigment {color White}}
  203.   object {Unit_Tetrahedron rotate <31.717474, 72, 0> pigment {color Blue}}
  204.   object {Unit_Tetrahedron rotate <31.717474, 144, 0> pigment {color Magenta}}
  205.   object {Unit_Tetrahedron rotate <31.717474, 216, 0> pigment {color Red}}
  206.   object {Unit_Tetrahedron rotate <31.717474, 288, 0> pigment {color Green}}
  207.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 0, 0> pigment {color Yellow}}
  208.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 72, 0> pigment {color Orange}}
  209.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 144, 0> pigment {color Cyan}}
  210.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 216, 0> pigment {color Pink}}
  211.   object {Unit_Tetrahedron rotate 90*y rotate <31.717474, 288, 0> pigment {color Grey}}
  212.   scale <0.419469, 0.419469, 0.419469>
  213.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  214.  
  215. #declare Five_Cubes_i =
  216. //Intersection defines a rhombic triacontahedron
  217. //Vertices define a dodecahedron
  218. intersection {  
  219.   object { Unit_Cube rotate <31.717474, 0, 0> pigment {color White}}
  220.   object { Unit_Cube rotate <31.717474, 72, 0> pigment {color Blue}}
  221.   object { Unit_Cube rotate <31.717474, 144, 0> pigment {color Magenta}}
  222.   object { Unit_Cube rotate <31.717474, 216, 0> pigment {color Red}}
  223.   object { Unit_Cube rotate <31.717474, 288, 0> pigment {color Green}}
  224.   scale <0.726542, 0.726542, 0.726542>
  225.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  226. }
  227.  
  228. #declare Five_Octahedra_i =
  229. //Intersection defines an icosahedron
  230. // Vertices define an icos1dodecahedron
  231. intersection {
  232.   object {Unit_Octahedron rotate <31.717474, 0, 0> pigment {color White}}
  233.   object {Unit_Octahedron rotate <31.717474, 72, 0> pigment {color Blue}}
  234.   object {Unit_Octahedron rotate <31.717474, 144, 0> pigment {color Magenta}}
  235.   object {Unit_Octahedron rotate <31.717474, 216, 0> pigment {color Red}}
  236.   object {Unit_Octahedron rotate <31.717474, 288, 0> pigment {color Green}}
  237.   scale <0.678716, 0.678716, 0.678716>
  238.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  239. }
  240.  
  241. #declare Octahedron_Cube_i =
  242. //Intersection defines a cuboctahedron
  243. //Vertices define a rhombic dodecahedron
  244. intersection {
  245.   object {Unit_Cube pigment {color Blue}}
  246.   object {Unit_Octahedron scale <1.154700, 1.154700, 1.154700> pigment {color White}}
  247.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  248. }
  249.  
  250. #declare Icosahedron_Dodecahedron_i =
  251. //Intersection defines an icosidodecahedron
  252. //Vertices define a rhombic triacontahedron
  253. intersection {
  254.   object {Unit_Dodecahedron pigment {color Red}}
  255.   object {Unit_Icosahedron scale <1.098014, 1.098014, 1.098014> pigment {color Green}}
  256.   bounded_by { sphere { < 0, 0, 0 >, 1.8 } }
  257. }
  258.  
  259. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  260. // ADD A SCENE     
  261. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  262.  
  263. global_settings { assumed_gamma 2.2 }
  264.  
  265. camera {
  266.    location < 20.0, 20.0, -60.0 >
  267.    direction < 0.0, 0.0, 6.0 >
  268.    up < 0.0, 1.0, 0.0 >
  269.    right < 1.33333, 0.0, 0.0 > 
  270.    look_at < 0.0, 0.0, 0.0 >
  271. }
  272.  
  273. light_source { < 100.0, 100.0, -100.0 > colour rgb 1 }
  274.  
  275. light_source { < -100.0, 0.0, -50.0 > colour rgb 0.5 }
  276.  
  277. object { Two_Tetrahedra translate < -6.0, 3.0, 0.0 > }
  278. object { Five_Tetrahedra translate < -3.0, 3.0, 0.0 > }
  279. object { Ten_Tetrahedra translate <  0.0, 3.0, 0.0 > }
  280. object { Five_Cubes translate <  3.0, 3.0, 0.0 > }
  281. object { Five_Octahedra translate <  6.0, 3.0, 0.0 > }
  282.  
  283. object { Octahedron_Cube translate < -6.0, 0.0, 0.0 > }
  284. object { Icosahedron_Dodecahedron translate < -3.0, 0.0, 0.0 > }
  285.  
  286. object { Two_Tetrahedra_i translate <  3.0, 0.0, 0.0 > }
  287. object { Five_Tetrahedra_i translate <  6.0, 0.0, 0.0 > }
  288.  
  289. object { Ten_Tetrahedra_i translate < -6.0, -3.0, 0.0 > }
  290. object { Five_Cubes_i translate < -3.0, -3.0, 0.0 > }
  291. object { Five_Octahedra_i translate <  0.0, -3.0, 0.0 > }
  292. object { Octahedron_Cube_i translate <  3.0, -3.0, 0.0 > }
  293. object { Icosahedron_Dodecahedron_i translate <  6.0, -3.0, 0.0 > }
  294.  
  295.